package com.tony.guice.Common;

import com.google.inject.Inject;
import com.google.inject.name.Named;

/**
 * @version V1.0  </br>
 * @ClassName PayPalCreditCardProcessor </br>
 * @Description TODO  </br>
 * @Author tonywang</br>
 * @DATE 2/28/2019 6:09 PM</br>
 */
public class PayPalCreditCardProcessor implements CreditCardProcessor {
    private static final String DEFAULT_API_KEY = "development-use-only";

    private String apiKey = DEFAULT_API_KEY;

    @Inject
    public PayPalCreditCardProcessor(@Named("PayPal API key") String apiKey) {
        this.apiKey = apiKey;
    }

    @Override
    public ChargeResult charge(String amount, CreditCard creditCard) throws Exception {
        return null;
    }

    @Inject
    public void setApiKey(@Named("PayPal API key") String apiKey) {
        this.apiKey = apiKey;
    }
}
